<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<style>
    #avatar img{width: 100px;height: 100px}
</style>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">

        <div><?php include "../public_flow/flow_show_info.php";?></div>

        <div class="table-box tablenes">
            <div class="title">基本信息</div>
            <table class="layui-table">
                <tbody>

                <tr><td class="tt">姓名</td><td id="realname" class="tv"></td><td class="tt">手机号</td><td id="tel" class="tv"></td></tr>
                <tr><td class="tt">所属部门</td><td id="deptid_name" class="tv" ></td><td class="tt">账号状态</td><td id="status_name" class="tv"></td></tr>
                <tr><td class="tt">角色</td><td id="roleid_name" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">用户头像</td><td id="avatar" colspan="3" class="tv"></td></tr>
                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>


        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_user_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data;
                $("#realname").text(data.realname);
                $("#tel").text(data.tel);
                $("#deptid_name").text(data.deptid_name);
                $("#roleid_name").html(data.roleid_name);
                $("#status_name").text(data.status_name);
                $("#explain").text(data.explain);
                if(data.avatar){
                    $("#avatar").html('<img onclick="show_avatar(\''+get_file_complete(data.avatar)+'\')" src="'+get_file_complete(data.avatar)+'">');
                }else{
                    $("#avatar").html('<img onclick="show_avatar(\'/static/admin/images/avatar.png\')" src="/static/admin/images/avatar.png">');
                }
                // $(".pageshowtitle").text('用户');

                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('user', param_id);
        showpage_dropopt();
    });


    function show_avatar(url){
        window.open(url);
    }
</script>
</body>
</html>




